% Written by: Orhan Torul
% Istanbul, Turkey, May 2017
function FUN = steadyshimer(y)
global beta delta xi kappa psi nu zss;
%y=[c u v q p R w chi]

% f_1=-psi/(q*(1-delta))+beta*((exp(zss))-w+psi/q);
% f_2=u*p-v*q;
% f_3=1-R*beta;
% f_4=-w+nu*((exp(zss))+psi*(v/u))+(1-nu)*chi;
% f_5=-chi+0.40*w;
% f_6=-(1-u)+(1-delta)*(1-u)+v*q;
% f_7=kappa*(u^xi)*(v^(1-xi))-v*q;
% f_8=exp(zss)*(1-u)+u*chi-c-psi*v;


f_1=-psi/(y(4)*(1-delta))+beta*((exp(zss))-y(7)+psi/y(4));
f_2=y(2)*y(5)-y(3)*y(4);
f_3=1-y(6)*beta;
f_4=-y(7)+nu*((exp(zss))+psi*(y(3)/y(2)))+(1-nu)*y(8);
f_5=-y(8)+0.40*y(7);
f_6=-(1-y(2))+(1-delta)*(1-y(2))+y(3)*y(4);
f_7=kappa*(y(2)^xi)*(y(3)^(1-xi))-y(3)*y(4);
f_8=exp(zss)*(1-y(2))+y(2)*y(8)-y(1)-psi*y(3);

%y=[c; u ;v ;q ;p ;R ;w ;chi]
FUN=[f_1;f_2;f_3;f_4;f_5;f_6;f_7;f_8];



